#include "TextureLoader.h"

Texture * TextureLoader::LoadFromFile(const char *filename)
{
	ImagePNG img;
	img.LoadImage(filename);
	int width, height, bpp;
	img.GetCapacities(width, height, bpp);
	BYTE *data = new BYTE[width * height * bpp];
	img.GetPixels(data);
	Texture *texture = new Texture(width, height, bpp * 8, data);
	delete [] data;

	return texture;
}